package com.ruoyi.common.constant;

import java.util.Arrays;

/**
 * 字典管理常量
 * @author chengliang
 * @date 2021/11/15
 **/
public enum DicConstants {
    PRO_ENV("pro_env","是否正式环境"),
    //消息类型
    CHAT_TYPE_text("text","文字"),
    CHAT_TYPE_img("img","图片"),
    CHAT_TYPE_video("video","视频"),
    CHAT_TYPE_order("order","订单"),
    CHAT_TYPE_voice("voice","语音"),
    //业务来源
    BUSINESS_Customer("Customer","客户端"),
    BUSINESS_Business("Business","商家端"),
    BUSINESS_Manager("Manager","管理端"),
    //系统是否
    SYS_Y("Y","是"),
    SYS_N("N","否"),
    //审核状态
    AUIT_STATE_IN("audit_IN","审核中"),
    AUIT_STATE_PASS("audit_PASS","审核通过"),
    AUIT_STATE_REFUSE("audit_REFUSE","审核拒绝"),
    //店家运营状态
    OPERATION_STATE_IN_Business("IN_Business","营业中"),
    OPERATION_STATE_IN_Rest("IN_Rest","休息中"),
    //门店状态
    STORE_STATE_Open("open","开启"),
    STORE_STATE_Close("close","关闭"),

    //门店或商品
    STOREORPRODUCT_STORE("store","门店"),
    STOREORPRODUCT_PRODUCT("product","商品"),
    //收藏类型
    COLLECT_TYPE_STORE("store","门店"),
    COLLECT_TYPE_PRODUCT("product","商品"),
    COLLECT_TYPE_MALL_PRODUCT("mall_product","商城商品"),
    //店铺角色
    STORE_Identity_Manager("store_manager","店长"),//唯一
    STORE_Identity_YunYing("store_yunYing","运营"),
    STORE_Identity_JiShi("store_jiShi","技师"),
    STORE_Identity_KeFu("store_keFu","客服"),

    //店铺功能权限
    STORE_fun_YanQuan("YanQuan","验券"),
    STORE_fun_StoreInfo("StoreInfo","门店资料"),
    STORE_fun_Finance("Finance","财务管理"),
    STORE_fun_Product("Product","团单管理"),
    STORE_fun_Comment("Comment","评价管理"),
    STORE_fun_Coupons("Coupons","优惠券管理"),
    STORE_fun_Technician("Technician","技师管理"),
    STORE_fun_VipPayment("VipPayment","续费管理"),


    //优惠券所属类型
    BELONG_TYPE_Plateform("platform","平台"),
    BELONG_TYPE_Store("store","门店"),

    //优惠券可用类型
    COUPON_TYPE_Classify("classify","品类券"),
    COUPON_TYPE_Product("product","商品券"),
    COUPON_TYPE_General("general","通用券"),

    //订单状态
    ORDER_STATE_Refund_Apply("refund_apply","申请退款"),
    ORDER_STATE_Refund_Success("refund_success","退款成功"),
    ORDER_STATE_Wait_Pay("wait_pay","待付款"),
    ORDER_STATE_Wait_Assgin("wait_assgin","待指定"),
    ORDER_STATE_Wait_Use("wait_use","待使用"),
    ORDER_STATE_Used("used","已使用"),
    ORDER_STATE_Aftersale("aftersale","待售后"),
    ORDER_STATE_Wait_Ship("wait_ship","待发货"),
    ORDER_STATE_Shipped("shipped","已发货"),
//    ORDER_STATE_Received("received","已收货"),
    ORDER_STATE_Received("received","已售后"),
    ORDER_STATE_FINISHED("finished","已关闭"),
  //  ORDER_STATE_OrderClose("order_close","订单关闭"),

    //退款状态
//    REFUND_STATUS_No("no","未退款"),
    REFUND_STATUS_Apply("apply","退款审核中"),
    REFUND_STATUS_Pass("pass","商家通过"),
    REFUND_STATUS_Refunding("refunding","退款中"),
    REFUND_STATUS_Refused("refused","拒绝退款"),
    REFUND_STATUS_Finished("finished","退款完成"),
    REFUND_STATUS_Successed("success","退款成功"),

    //结算状态
    BILLING_STATE_No("no_billing","未结算"),
//    BILLING_STATE_In("in_billing","结算中"),同步返回结果没有结算中的状态
    BILLING_STATE_Fail("fail_billing","结算失败"),
    BILLING_STATE_End("end_billing","已结算"),
    //提现申请状态
    WITHDRAW_STATE_Audit("audit","审核中"),
    WITHDRAW_STATE_Pass("pass","已通过"),
    WITHDRAW_STATE_In_Remit("in_remit","汇款中"),
    WITHDRAW_STATE_Success_Remit("success_remit","汇款成功"),
    WITHDRAW_STATE_Fail_Remit("fail_remit","汇款失败"),
    WITHDRAW_STATE_Refused("refused","已拒绝"),

    //优惠券获取途径
    RECEIVE_TYPE_Receive("receive","领取"),
    RECEIVE_TYPE_Gift("gift","赠送"),
    RECEIVE_TYPE_CDK("cdk","cdk兑换"),

    DIV_TYPE_ORDER("order","订单分账"),
    DIV_TYPE_PLATFORMPAY("platPay","平台余额支付"),

    /**
     * 流水操作类型入账出账
     */
    HANDLE_BALANCE_ADD("add","入账"),
    HANDLE_BALANCE_SUB("sub","出账"),
    /**
     * 流水业务类型
     */
    BUSTYPE_BALANCE_Drawcash("drawcash","提现"),
    BUSTYPE_BALANCE_DIV("div","分账"),
    BUSTYPE_BALANCE_BalancePay("balancePay","余额支付"),
    BUSTYPE_BALANCE_MALL_DRAWCASH("mall_drawcash","商城提现"),
    BUSTYPE_BALANCE_MALL_DIV("mall_div","商城分账"),

    BUSTYPE_BALANCE_PRO("pro","项目收入"),
    BUSTYPE_BALANCE_BELT("belt","老带新收入"),
    BUSTYPE_BALANCE_PUSH("push","推广收入"),

    HUIFU_PAYSTATE_SUCCESS("succeeded","支付成功"),
    HUIFU_PAYSTATE_FAILED("failed","支付失败"),
    HUIFU_PAYSTATE_INIT("init","未支付"),

    /**
     * 优惠券使用状态
     */
    USER_STATE_UNUSED("unused","未使用"),
    USER_STATE_ALREADY("already_use","已使用"),
    USER_STATE_PAST_DU("past_due","已过期"),

    //论坛发布端
    BBS_PUBLISH_MERCHANTS("merchants","B端"),
    BBS_PUBLISH_CLIENT("client","C端"),

    //区分优惠卷和兑换码
    DISTINCTION_CDK("cdk","兑换码"),
    DISTINCTION_COUPON("coupon","优惠卷"),
    /**
     * 论坛点赞收藏标识
     */
    BBS_OPTIOPN_LIKE("like","点赞"),
    BBS_OPTIOPN_COLLECT("collect","收藏"),
    /**
     * 订单操作类型
     */
    ORDER_PRODUCT("product_order","团购订单"),
    ORDER_MALL("mall_order","商城订单"),

    /**
     * 积分操作类型
     */
    INTEGRAL_TYPE_POINT("spend_points","消费送积分"),
    INTEGRAL_TYPE_CASH("points_for_cash","积分抵现"),
    INTEGRAL_TYPE_PUSH("push_points","分享送积分"),

    //预约状态Appointment APPOINTMENT
    APPOINTMENT_init("init","预约成功"),
    APPOINTMENT_reach_store("points_for_cash","已到店"),
    APPOINTMENT_before_shop("before_shop","未到店"),
    APPOINTMENT_cancel("cancel","已取消"),

    //店面装修类型
    FITMENT_TYPE_SINGLE("sigle","头图"),
    FITMENT_TYPE_MULTIPLE("multiple","群相册"),

    //文件类型
    MEDIA_TYPE_IMG("image","图片"),
    MEDIA_TYPE_VIDEO("video","视频"),

    //无用方便中间加数据
    UnKnow_Code("UnKnow_Code","获取失败");

    private String code;
    private String name;
    DicConstants(String code, String name){
        this.code = code;
        this.name = name;
    }
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static DicConstants getEnum(String code) {
        for (DicConstants enums : DicConstants.values()) {
            if (enums.code.equals(code)) {
                return enums;
            }
        }
        return null;
    }

}
